home *** CD-ROM | disk | FTP | other *** search
/ Super PC 34 / Super PC 34 (Shareware).iso / spc / UTIL / DJGPP2 / V2 / DJDEV200.ZIP / include / libc / file.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-07-25  |  1.3 KB  |  57 lines

  1. /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
  2. #ifndef __dj_include_libc_file_h__
  3. #define __dj_include_libc_file_h__
  4.  
  5. #ifdef __cplusplus
  6. extern "C" {
  7. #endif
  8.  
  9. #ifndef __dj_ENFORCE_ANSI_FREESTANDING
  10.  
  11. #ifndef __STRICT_ANSI__
  12.  
  13. #ifndef _POSIX_SOURCE
  14.  
  15. #define _IOREAD   000010
  16. #define _IOWRT    000020
  17. #define _IOMYBUF  000040
  18. #define _IOEOF    000100
  19. #define _IOERR    000200
  20. #define _IOSTRG   000400
  21. #define _IORW     001000
  22. #define _IOAPPEND 002000
  23. #define _IORMONCL 004000  /* remove on close, for temp files */
  24. /* if _flag & _IORMONCL, ._name_to_remove needs freeing */
  25.  
  26. int    _flsbuf(int, FILE*);
  27. int    _filbuf(FILE *);
  28. void    _fwalk(void (*)(FILE *));
  29.  
  30. #define __getc(p) (--(p)->_cnt>=0 ? \
  31.   (int)(*(unsigned char*)(p)->_ptr++) : \
  32.   _filbuf(p))
  33.  
  34. #define __putc(x,p) (--(p)->_cnt>=0? \
  35.   ((int)((unsigned char)((*(p)->_ptr++=(unsigned)(x))))): \
  36.   _flsbuf((unsigned)(x),p))
  37.  
  38. #undef  fileno
  39. #define fileno(f)    (f->_file)
  40. #undef  feof
  41. #define feof(f)        (((f)->_flag&_IOEOF)!=0)
  42. #undef  ferror
  43. #define ferror(f)    (((f)->_flag&_IOERR)!=0)
  44.  
  45. #endif /* !_POSIX_SOURCE */
  46. #endif /* !__STRICT_ANSI__ */
  47. #endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
  48.  
  49. #ifndef __dj_ENFORCE_FUNCTION_CALLS
  50. #endif /* !__dj_ENFORCE_FUNCTION_CALLS */
  51.  
  52. #ifdef __cplusplus
  53. }
  54. #endif
  55.  
  56. #endif /* __dj_include_libc_file_h__ */
  57.